// 调试用户角色和路由权限
console.log('=== 用户角色调试信息 ===');

// 获取用户信息
const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}');
console.log('用户信息:', userInfo);
console.log('用户角色:', userInfo.roles);

// 检查manage_role路由所需的角色
const requiredRoles = ['R_SUPER', 'R_ADMIN'];
console.log('manage_role路由所需角色:', requiredRoles);

// 检查用户是否有权限
const userRoles = userInfo.roles || [];
const hasPermission = requiredRoles.some(role => userRoles.includes(role));
console.log('用户是否有权限访问manage_role:', hasPermission);

// 检查路由是否存在于Vue Router中
if (window.$router) {
  const routes = window.$router.getRoutes();
  const manageRoleRoute = routes.find(route => route.name === 'manage_role');
  console.log('manage_role路由是否在Vue Router中:', Boolean(manageRoleRoute));
  if (manageRoleRoute) {
    console.log('manage_role路由详情:', manageRoleRoute);
  }
} else {
  console.log('Vue Router未找到，请在应用加载后执行此脚本');
}
